<template>
	<view class="content">
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		onLoad() {
			this.getinfo()
		},
		methods: {
			getinfo(){
				var token =uni.getStorageSync('token')
				if(token==''||token==null){
					uni.reLaunch({
					    url:'../login/login'
					})
				}else{
					this.http({
					 	url:'/api/Page/my',
					 	method:'POST',
						header:{
							'token':token
						},
					 	success:(res)=>{
							console.log(res)
							this.avantar = res.data.avantar
							this.nickname =res.data.nickname
							this.fil = res.data.fil
						},
					 	error:()=>{
					 		uni.showToast({
					 			title:"请求异常"	
					 		})
					 	},
						complete:(res)=>{
							console.log(res.code)
							// token过期的处理方式
							if(res.code==1201){
								uni.removeStorage({
									key:'token'
								})
								uni.reLaunch({
									url:'../login/login'
								})
							}
						}
					 })
				} 
			},
		}
	}
</script>

<style lang="scss">
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		font-family: PingFang SC;
		font-weight: 500;
		color:#2b2b2b;
		padding-bottom: 50rpx;
	}

	
</style>
